package org.easy.core.dto;


import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class PageResult<T> extends R<T> {
    private int pageSize;
    private int pageNum;
    private long total;


    public static <T> PageResult<T> success(T data, long total) {
        return new PageResult<>(SUCCESS, null, data, 1, 20, total);
    }

    public static <T> PageResult<T> success(T data, int pageNum, int pageSize, long total) {
        return new PageResult<>(SUCCESS, null, data, pageNum, pageSize, total);
    }

    public PageResult(int code, String msg, T data, int pageNum, int pageSize, long total) {
        super(code, msg, data);
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.total = total;
    }


}
